<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>点击控制文本显示，按钮随之变化</title>
</head>

<body>


  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <div id="Application">
    <h1 v-if="show">标题</h1>
    <button @click="clickShow()">{{show ? "不显示" : "显示" }}标题</button>
  </div>
  <script>
    const App = {
      setup() {
        const show = Vue.ref(true);
        const clickShow = () => {
          show.value = !show.value;
        };
        return {
          show,
          clickShow,
        };
      },
    };
    Vue.createApp(App).mount("#Application");
  </script>
</body>

</html>